#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START dosfstools-native

save_CFLAGS="$CFLAGS"
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
export CFLAGS='-O2 -g'
unset CPPFLAGS
unset LDFLAGS


reset_mtime dosfstools dosfstools/configure.ac
mkdir -p build/dosfstools-native
cd build/dosfstools-native
../../dosfstools/configure \
	--host="$BUILD" \
	--build="$BUILD" \
	--prefix="$build_prefix" \
	--sbindir="$build_prefix/bin" \
	${AUTOCRAP_KLUDGE}

cd ../..
make_native_build build/dosfstools-native

export CFLAGS="$save_CFLAGS"
export CPPFLAGS="$save_CPPFLAGS"
export LDFLAGS="$save_LDFLAGS"

# RECIPE END dosfstools-native
